package com.pig4cloud.pig.flow.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.pig.common.core.util.R;
import com.pig4cloud.pig.flow.api.dto.ApprovalDTO;
import com.pig4cloud.pig.flow.api.dto.FlowSearchDTO;
import com.pig4cloud.pig.flow.api.dto.StartFlowDTO;
import com.pig4cloud.pig.flow.api.dto.SuspensionDTO;
import com.pig4cloud.pig.flow.api.vo.FlowVO;
import com.pig4cloud.pig.flow.pojo.dto.FlowDTO;
import org.camunda.bpm.engine.repository.ProcessDefinition;

/**
 * @author mobai
 */
public interface FlowService {
	R<Boolean> deployment(FlowDTO body);



	ProcessDefinition getProcessDefinition(String key, Integer version);

	R getFlowJson(String flowKey, Integer version);

	R getFlowVersion(String key);

	R updateFlowVersion(String key, Integer version);

	R<String> startProcessInstance(StartFlowDTO startFlowDTO);

	R getFlowJsonByProcessInstanceId(String processInstanceId);

	R getHistoryNode(String processInstanceId);

	R completeTask(ApprovalDTO approvalDTO);

	R updateSuspendState(SuspensionDTO suspensionDTO);

	Page<FlowVO> myStartPage(Page page, FlowSearchDTO flowSearchDTO);

	Page<FlowVO> myApprovalPage(Page page, FlowSearchDTO flowSearchDTO);

	R getTaskPermission(String taskId);

	Page<FlowVO> myDonePage(Page page, FlowSearchDTO flowSearchDTO);


	R terminationProcess(ApprovalDTO approvalDTO);

}
